package com.itheima.health.dao;

import com.itheima.health.pojo.Order;
import com.itheima.health.pojo.OrderSetting;
import org.apache.ibatis.annotations.*;

import java.util.Date;
import java.util.List;

@Mapper
public interface OrderSettingDao {

    /**
     * 当月预约信息展示
     *
     * @param startDate
     * @param endDate
     * @return
     */
    List<OrderSetting> getOrderSettingByMonth(String startDate, String endDate);

    /**
     * 可预约单独修改
     *
     * @param number
     */
    @Update("UPDATE t_ordersetting SET number = #{number} WHERE id = #{id}")
    void editNumberById(Integer id, Integer number);

    /**
     * 根据日期查询
     */
    OrderSetting selectByOrderDate(@Param("orderDate")String orderDate);

    /**
     * 可预约单独新增
     */
    @Insert("insert into t_ordersetting(orderDate,number) values (#{orderDate},#{number})")
    void insertOrderDate(String orderDate, Integer number);


    /**
     * 根据id更新已预约人数
     *
     * @param id
     * @param reservations
     */
    void updateReservationsById(@Param("id") Integer id, @Param("reservations") int reservations);



}